/**
 * 
 */
package tests;

import static org.junit.Assert.*;

import java.util.ArrayList;

import network.Address;
import network.INetwork;
import network.SimulatedInternet;
import network.Subscriber;

import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import coreAlgorithm.ID;
import coreAlgorithm.Node;
import coreAlgorithm.NodeTestSubclass;
import coreAlgorithm.NodeTriple;
import coreAlgorithm.command.PingCommand;

/**
 * @author Pentius
 * 
 */
public class NodeTest {

	private static final int NodeID = 50;

	/**
	 * @throws java.lang.Exception
	 */
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	private INetwork network;

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
//
//		network = new SimulatedInternet();
//		NodeTestSubclass node = new NodeTestSubclass(new ID(NodeID));
//		node.networkLogon(network);
//		Address nodeAddress = node.generateNodeTriple().getAddress();
//
//		// Fill node's buckets with 100 nodes
//		for (int i = 0; i < 101; i++) {
//			if (i == NodeID)
//				continue;
//			Node tempNode = new Node(new ID(i));
//			tempNode.networkLogon(network);
//			network.sendCommand(nodeAddress, new PingCommand(tempNode.generateNodeTriple()));
//		}
//
//		System.out.println("After insertion of the nodes:");
//		node.printKBuckets();
//		System.out.println();
//		
//		ArrayList<NodeTriple> findNearestNodesToGivenID = node.findNearestNodesToGivenID(new ID("110101"), 20);
//		System.out.println(findNearestNodesToGivenID);

	}

	/**
	 * Test method for {@link coreAlgorithm.Node#findNearestNodesToGivenID(coreAlgorithm.ID, int)}.
	 */
	@Test
	public void testFindNearestNodesToGivenID() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#getId()}.
	 */
	@Test
	public void testGetId() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#Node(coreAlgorithm.ID)}.
	 */
	@Test
	public void testNode() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#getClock()}.
	 */
	@Test
	public void testGetClock() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#receiveCommand(coreAlgorithm.command.Command)}.
	 */
	@Test
	public void testReceiveCommand() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#getKBucket(int)}.
	 */
	@Test
	public void testGetKBucket() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#networkLogon(network.INetwork)}.
	 */
	@Test
	public void testNetworkLogon() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#networkLogoff()}.
	 */
	@Test
	public void testNetworkLogoff() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#generateSubscriber()}.
	 */
	@Test
	public void testGenerateSubscriber() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#generateNodeTriple()}.
	 */
	@Test
	public void testGenerateNodeTriple() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#sendPing(network.Address)}.
	 */
	@Test
	public void testSendPing() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#whenHaveYouLastSeen(coreAlgorithm.ID)}.
	 */
	@Test
	public void testWhenHaveYouLastSeen() {
		fail("Not yet implemented");
	}

	/**
	 * Test method for {@link coreAlgorithm.Node#printKBuckets()}.
	 */
	@Test
	public void testPrintKBuckets() {
		fail("Not yet implemented");
	}

}
